//
//  HYBaseHandler.m
//  Around
//
//  Created by 华谕 on 2017/6/13.
//  Copyright © 2017年 HUYU. All rights reserved.
//

#import "HYBaseHandler.h"

@implementation HYBaseHandler

//首页轮播图/banner/findAll
+ (void)requestHomeBannerParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_HomeBanner params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//登录/user/login
+ (void)requestLoginUserParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_LoginUser params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//忘记密码验证码/user/code4findpsw
+ (void)requestForgoPassParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_ForGoPass params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//修改密码/user/findpsw
+ (void)requestChangePassParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_ChangePass params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}


//专线查询次数/systemConfig/stationLineQueryCount
+ (void)requestQueryCountParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_QueryCount params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//定位地区表/area/findAll
+ (void)requestAreaListParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_AreaList params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//查询起始地,目的地
+ (void)requestStartAreaListParmers:(NSDictionary *)parmers SelectType:(NSInteger)selectType Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    NSString *url = SERVER_StartAreaList;
    if (selectType == 2)
    {
        url = SERVER_StopAreaList;
    }
    [HttpTool postWithPath:url params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//注册请求验证码/user/code4register
+ (void)requestCodeRegisterParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_CodeRegister params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//注册/user/register
+ (void)requestUserRegisterParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_UserRegister params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//入驻类型/serve/findAll
+ (void)requestCompanyInTypeParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_CompanyType params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//查询专线列表/stationLine/page
+ (void)requestStationLineParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_StationLine params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//获取客服电话 /systemConfig/servicePhone
+ (void)requestServicePhoneParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_ServicePhone params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//推荐优质专线/recommend/save
+ (void)requestRecommendSavePhoneParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_recomSave params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//公司查询 /company/select
+ (void)requestCompanySelectParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_companySelect params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//公司服务站点 /station/findByCompany
+ (void)requestStatioFindByCompanyParmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:SERVER_companyStation params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//通用表单
+ (void)requestWithTheFormUrl:(NSString *)url Parmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPath:url params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}

//通用Json
+ (void)requestWithJsonUrl:(NSString *)url Parmers:(NSDictionary *)parmers Success:(SuccessBlock)success failed:(FailedBlock)failed
{
    [HttpTool postWithPathJson:url params:parmers success:^(id json) {
        success(json);
    } failure:^(NSError *error) {
        failed(error);
        
    }];
}


@end
